UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IljiwgmzzuGiN1SWBxJ8gFPR+U7dy9iL5UPCMpyVcBw='
WHERE
key_id = 'e8044f1f42ef7f0621ac789eb1c880aef6d5d4e68faf38cc45d111f09fc02bcf'
AND (
token = 'IljiwgmzzuGiN1SWBxJ8gFPR+U7dy9iL5UPCMpyVcBw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)