UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hhGAtwvQpv/6vofUGoJdFBMAuqan9w5On/TgGNBiB54='
WHERE
key_id = '3df4eba32b0b138b60c2b3946190a196ab7e11f1325759d3051cd22b7b68d97e'
AND (
token = 'hhGAtwvQpv/6vofUGoJdFBMAuqan9w5On/TgGNBiB54='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)