UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IShkvZ/l5A0ogyJykQ3ObmkPe3A73HrGJuBMUTbc99I='
WHERE
key_id = '87a10d5ad77a068ec0eaa1a685b8b4171686c0828fb6758242850e6645e7337f'
AND (
token = 'IShkvZ/l5A0ogyJykQ3ObmkPe3A73HrGJuBMUTbc99I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)