UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2NpYRnP6Aos5I77goHNO8zKJYaO/VMYl+lV6c6HFj9g='
WHERE
key_id = '2ed0d5b2465d6507bbb4a64ffe46f3968c2ccd6cb10d7b7e2fb94f24e622905d'
AND (
token = '2NpYRnP6Aos5I77goHNO8zKJYaO/VMYl+lV6c6HFj9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)