UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NF6Onvmg0L/39Yvf76mcN7CPO/L7l18j6+/BdQ2zwkA=' 
WHERE 
  key_id = 'e5bbc9dc496075858f0d1fee89f73738b537776ad6cfbb0696cc75b794affd37' 
  AND (
    token = 'NF6Onvmg0L/39Yvf76mcN7CPO/L7l18j6+/BdQ2zwkA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047