Unless you are horrid to your battery I would assume it will last more than the two year upgrade time. HTC disabled fast charging to extend battery life so that is the first step. If you want to ensure your battery lasts the life of your contract some things you can do are: Never let your battery completely die. Avoid letting the battery getting very low as often as possible. To do these things it's pretty simple. If you have access to a means of charging, plug your phone in. Here is an article if you care to read more.
How to Prolong Lithium-based Batteries - Battery University