If it is a US model and you know what network it was originally sold through you may be able to download the software directly from HTC:
https://www.htc.com/us/support/rom-downloads.html.
These downloads will probably be windows executables, so you would connect the phone to a PC and run the program on the computer. Unless the phone has been modified (e.g. says S-Off on the bootloader screen) it should not apply the update unless it's for the right network.
If you do this back up everything first, as it will wipe the phone in the process.
US carrier handsets will have been locked to the carrier originally. If it was unlocked officially then running an update like this will not relock it. If some hack was used to unlock it I cannot guarantee that a software update won't undo it (I think it's not likely, but cannot promise).