UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ToO0GQSEKnBUE+g19X6WP1bSJ793K8JUH05cBPfQPJ4='
WHERE
key_id = '6cc93c466e8184423bbfc312bf3a2d9d344b77b83087d6a2bc0209e8ee790798'
AND (
token = 'ToO0GQSEKnBUE+g19X6WP1bSJ793K8JUH05cBPfQPJ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)