UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C4htpB5psC81EfkPMK51C7qhp+E29vB0KFOyaWYHIQU='
WHERE
key_id = '369d9965ac471f22d4530cb277bd4998c08f15132d7916f964cc46cf54ef8e64'
AND (
token = 'C4htpB5psC81EfkPMK51C7qhp+E29vB0KFOyaWYHIQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)