Replacing the flame sensor won't fix your problem. Does your furnace have a circuit board? Does the gas valve have 24 volts across it as it drops out if so replace valve. If 24 volts drops out as flame drops out replace control board. Make sure rollout switches aren't opening.