So long as you seal the dry flakes into a solid, airtight container (like a cleaned out salt pail with a gasket in the lid) they should last longer than you do. As inert sand, there aren't any biological or chemical processes that would contribute to deterioration. The only issues you'd need to worry about over the decades would be contamination from airborne particulates like dust, dander or grease. Storage in the bucket would prevent that.
Then, in 40 years when you set up your tank, you'll rinse the sand and allow it to cycle in naturally just like you'd do with a bag you opened to set up a tank tomorrow.