UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yYYHFOolMh5mQI3+UCUvvQDArtKaiQ1jpEVlXJW3kxE='
WHERE
key_id = 'c48438f0a7c09b8156b389c493a57ff7897fa80d0a3906781010db6a1fb4e362'
AND (
token = 'yYYHFOolMh5mQI3+UCUvvQDArtKaiQ1jpEVlXJW3kxE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)