UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nrMypaMsVdxBPIPznXtMGu4qLUggHVzmJ0N04haCKBc=' 
WHERE 
  key_id = '891476bed8c82464c5169a6f37152625c6fdd01b6087b1f590356fc173fd79a7' 
  AND (
    token = 'nrMypaMsVdxBPIPznXtMGu4qLUggHVzmJ0N04haCKBc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036