UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TGapfMtDWtuZ7gpGdz1d/SSude61nphcux0kPmMDM/o=' 
WHERE 
  key_id = 'e1a1c56c598e81bc2d6421f64866483a8bfd70a38aac8c29557910bb91363f54' 
  AND (
    token = 'TGapfMtDWtuZ7gpGdz1d/SSude61nphcux0kPmMDM/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027