UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QXl86js9ACOr8CQ+UJS8tnGIGBKS1ElNiOQzHmE1qho='
WHERE
key_id = 'fc663df3b93ae732e798ffb23dc3c84ab4c2dfa87e40f1fbe944139c1862d475'
AND (
token = 'QXl86js9ACOr8CQ+UJS8tnGIGBKS1ElNiOQzHmE1qho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)