It depends on if the store rotates their stock (if they keep putting the new stock out front, the old ones sit in the back almost forever).
I buy the brand(s) that note a date on the package, and sort thru the store's stock until I find the one with the date furthest out into the future.
Also, I would look into why your old ones died. If you don't address that, the replacement ones could quickly die too. For example, if a button is getting continuously pressed "accidentally" when stored away in your pocket or purse. :shrug: