UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JD47bQNYpB8MxLPG7Eh8d938QVyKh4VBb0QAuLZ59Gc='
WHERE
key_id = '9250cd8a45e860044b5d06c7fe1b6b3da889726dd6d6814442fae4ae4ffe715d'
AND (
token = 'JD47bQNYpB8MxLPG7Eh8d938QVyKh4VBb0QAuLZ59Gc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)