UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+OXnupPC+OkPQSrs5dhmKhTNqf7Pxp2WfYoWRqfDmc4='
WHERE
key_id = '0a9d110306839380a9c6cb8130820e2b6942d74b89a65bb95e12da70f8bba0fe'
AND (
token = '+OXnupPC+OkPQSrs5dhmKhTNqf7Pxp2WfYoWRqfDmc4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)