UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K53Kd9ucayh4kRpSXfmQ1Y+H7+eTfvoz5j6pg9JUZvg='
WHERE
key_id = 'fcab44275f2842ed38d3324d454c4b8655030b18a1b26fcb1bc90ec2c7667cb8'
AND (
token = 'K53Kd9ucayh4kRpSXfmQ1Y+H7+eTfvoz5j6pg9JUZvg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)