There are high temp lubricants that will stay put, but there's a difference between a lubricant and a rust protection product.
Some high temp lubes offer no rust protection.
I just apply a light coat of CLP Breakfree to the steel parts on my AR, including the barrel.
It gets hot and smokes very little, but CLP is good up to at least 450 degrees.
Unless you have a really cheap AR the barrel is coated with a phosphate protective coating specifically designed to prevent rust, all you really need to do is after shooting is to allow the barrel to cool, then apply a little more CLP.
Personally, I keep a clean, soft toothbrush handy with a few drops of CLP on it.
After shooting or a lot of handling I "scrub" the steel parts to leave a thin coat of CLP on it.
CLP Breakfree is one of the top rust preventing lubes, and since the military use a CLP and don't get rusty rifles I figure I'm good to go.