UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H+oeW+fpowruuY4xJoVgp+om7fsUtyW35bftGyjHBu0='
WHERE
key_id = '815d2cd3e3fa00e9330a6fcbb820ccbd308f8971774ff7b8e7b09aa3dd35afaa'
AND (
token = 'H+oeW+fpowruuY4xJoVgp+om7fsUtyW35bftGyjHBu0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)