UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vaJeVv+xvjpVeQKlAMRKUY1jq5E+udgTHvS/5oVITmA='
WHERE
key_id = 'e54799d0061569b477fdb24a1a812a7923fabb96a57ba257eca9264b5e5eaf4a'
AND (
token = 'vaJeVv+xvjpVeQKlAMRKUY1jq5E+udgTHvS/5oVITmA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)