UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B2U1rSfrbR7FWcRJtLM8QWL64m/18ljxamFnSaRfmLM=' 
WHERE 
  key_id = 'c2e58bd4da49e145df0225d15d1012caac6b06316901041ea28ec19ebde57727' 
  AND (
    token = 'B2U1rSfrbR7FWcRJtLM8QWL64m/18ljxamFnSaRfmLM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050