UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XjKbqNe89rnK14TCMLzMZTUcogu4bRrHmO4QJ4y224I='
WHERE
key_id = '5fd7f9f1da3421c736002d5a99e0705ed4170f0b1ae47ec3430b7c3e8e4d92d4'
AND (
token = 'XjKbqNe89rnK14TCMLzMZTUcogu4bRrHmO4QJ4y224I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)