The upgrade of a GTX 335 to the GTX 345 is relatively easy, however is not a “plug-and-play” swap.
The GTX 345 includes integrated ADS-B In capability while the Garmin GTX 335 is ADS-B Out only.
Both units share a similar form factor in the mounting rack and main connector but upgrading requires:
For a detailed assessment of your aircraft and avionics configuration, it’s best to consult with an experienced avionics shop.