UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tAR+PE4zeqYiQlkqu4iqOeqKvDLMjpMDn1ifw6pcE9A='
WHERE
key_id = 'e14ed5ebc3a43f6b51584dcf52ba810af9f1ee853318669a2a794b064439f9ce'
AND (
token = 'tAR+PE4zeqYiQlkqu4iqOeqKvDLMjpMDn1ifw6pcE9A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)