A cooler will help dampen the peaks and valleys of temperature. IMO it's worth doing. But extreme heat will generally reduce shelf life.

My always-in-car food stash is pretty barbaric: about 2 kg (4.5 lb) of cheapo peanut butter. Fat, protein, salt, and simple carbs. I can usually get water and fuel from the places I go to, but ready calories are hard to come by.

I think the current batch of PB is the wally-world house brand. I keep it factory sealed and under temperature-reducing cover, but I don't baby it. Nobody will break into that stuff unless they're really hungry. I get about 2 years' trunk (shelf) life, based on tests. After that it turns into dog treats.

When I'm on a long drive, I add stuff that's a little more edible, jerky+crackers+cheese+gorp, if only to avoid the obscene price hike in mountain resorts.