From what I can gather from online research, which we all know is not always the most reliable, DEF has a shelf life of 2 years when stored at 86 Degrees F. As the temperature increases the shelf life shortens. Here are the few of the numbers that I could come up with.
32* : Infinite
50* : 75 Years
68* : 11 Years
86* : 23 Months
95* : 10 Months
104* : 4 Months
122* : 1 Month
140* : 1 Week.
The problem comes in when the big box stores leave the DEF in their warehouse at who knows what temp for an extended period and then place it on the shelf for you to buy. I would think that most truck stops would end up using their fluid in the tanks fairly regularly so it may be a safer to buy from them than at your local Wally World.