UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DstFsOzY3Wn8SW4oUYLQFjwbQFDuATOIsbVdYTs7QvA='
WHERE
key_id = '1c999098782cf41990fb7d64fe678977d44877cbde55f52b572a66d70afe2db9'
AND (
token = 'DstFsOzY3Wn8SW4oUYLQFjwbQFDuATOIsbVdYTs7QvA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)