UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bCCHJyK5R0Fex/ah4c8n0RwmXXCcbROEgOLcEV6uPUU='
WHERE
key_id = 'd7bed2f6d6ca92c89784bdbaf345fc1d354ce19bb5e2f5add644078e2bee5a7f'
AND (
token = 'bCCHJyK5R0Fex/ah4c8n0RwmXXCcbROEgOLcEV6uPUU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)