UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZERpXA88VuKY0zyjttRHhKrmPPeFHeBVj5Evq09e6og=' 
WHERE 
  key_id = '103b8da9d41d2890c52465064ff01888f7786961c4d8209ad0714b69ec19ba3b' 
  AND (
    token = 'ZERpXA88VuKY0zyjttRHhKrmPPeFHeBVj5Evq09e6og=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015