Hi, according to your age a heart rate of 140 to 150 you the target heart rate during exercise and you are achieving that target during most of the exercises. If you are sure about the machines in the gym reading a heart rate of 170, there is nothing to worry as your maximum heart rate can be around 180 during exercise. Sometimes the exercise machines are not much reliable in detecting the heartrate. You may note your heart rate by counting the pulse for one minute immediately after doing exercise. I hope this helps
Yeah I have a pretty good idea what might be. Get a quality personal heart rate monitor. If the machines are right you need to get a referral to a specialist because only after an official diagnosis on your medical records is it going to be treated. Although in your highly fit case, right now treatment options might not be to your liking but those are conversations netween you and the specialist.