UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4n7oQKF+KZ6SKKYqiR/DGN904fl63uAtTYWtaGMtbsI='
WHERE
key_id = 'a57ca31885f1eca31ddb14a0caa804ec10c835ddcd90b5b5a153b12a60af3548'
AND (
token = '4n7oQKF+KZ6SKKYqiR/DGN904fl63uAtTYWtaGMtbsI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)