Like most spices, 5 spice powder doesn't expire or go bad so to speak if kept dry in an airtight container. (If stored improperly or if it gets wet etc, it may go moldy- in that case, toss and don't use!) However, as time goes by, the powder will start losing flavour.  This happens quite quickly which is why I advocate keeping the whole spices instead. (They keep their fragrance for a longer time and, for best flavor, you can use a coffee grinder, spice grinder, or mortar and pestle to turn them into homemade 5-spice powder when you need it.)