UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G8XVg+wOz3QC3sKj51WI/Gz+8RLjjQpADOXiRBOWy6g=' 
WHERE 
  key_id = '2d35a17573a89d5a67d925719a44cb9855dfe39f4cd6becf3bdcaa80de931e7e' 
  AND (
    token = 'G8XVg+wOz3QC3sKj51WI/Gz+8RLjjQpADOXiRBOWy6g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031