UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3RVRIgZ8sZnFtOXJIok7iRc/hrLVoZQ3i9gnh6vvv78='
WHERE
key_id = '57d0192a236cc5ed059b9c7a312cc58cd929c7bcc7f68b7d99a1aeda0b668d15'
AND (
token = '3RVRIgZ8sZnFtOXJIok7iRc/hrLVoZQ3i9gnh6vvv78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)