A box of prepackaged cake mix, which usually has a "best before" date rather than an expiration date, can usually be used for up to 5 months past the box's printed date. This is contingent on the box being unopened and kept in a cool, dry place, such as a kitchen pantry.
There are certain ways to tell if a boxed cake mix, brownie mix or muffin mix has gone bad. Once the wet ingredients, such as water, oil, milk or eggs are added to the mix, the cake should rise when baked. This is because the wetness activates the leavening ingredients (typically baking powder or baking soda) in the cake mix. If the mix has gone bad, the cake will be flat and dense, and should be discarded.