UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2/iQlXrge/XHdlHCqlSC32RLwdAt27JkTXbIG6KMXwI=' 
WHERE 
  key_id = '80064123b2905c25e4b500641e247de16a4cf692c59d5313c31da5036e0dd8b5' 
  AND (
    token = '2/iQlXrge/XHdlHCqlSC32RLwdAt27JkTXbIG6KMXwI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027