UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FXARJ+s6xXUaAgBeeCutRuTHniV+GqGdDfQfVt99yRo='
WHERE
key_id = '5652ea247c0292415b084bc589ce29eca37ca67a1c04e6e9b91f8db0b07e5a70'
AND (
token = 'FXARJ+s6xXUaAgBeeCutRuTHniV+GqGdDfQfVt99yRo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)