UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CvYnGuCkkqC4TR4udlRoxB6onnQHgtqFY/4yRBJP0gI=' 
WHERE 
  key_id = '09e5b790738d8be6d9bef55806f70c3b9369fd4a575301f6fdee0d8530caa222' 
  AND (
    token = 'CvYnGuCkkqC4TR4udlRoxB6onnQHgtqFY/4yRBJP0gI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030