UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MN/5JF9isMTb5IKc0bklr+20D4lYMhjfKd8NARzbVU0='
WHERE
key_id = 'b6057a71be2de0baf44252cb13e685b3bde65c9d8d73b4acd13ef0fd4afb3cb6'
AND (
token = 'MN/5JF9isMTb5IKc0bklr+20D4lYMhjfKd8NARzbVU0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)