UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y+ZMVdd2M2g923vN4DMOSkhg+1q7UmD0xs5NcIsngQY='
WHERE
key_id = '88cc2fcf45a06a65dcf9116a7779ab4cbfda98d6a1e933d6848850f20de7973f'
AND (
token = 'y+ZMVdd2M2g923vN4DMOSkhg+1q7UmD0xs5NcIsngQY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)