Any decent coach will ensure the safety of fighters remains their top priority. If you ever feel as though your wellbeing or that of other fighters is being neglected, find a new gym.
As far as sparring goes, offence is actually a vital component of defence, so you're better off learning to throw punches as well as how to block, parry and move, even if defence is your primary objective. Your sparring partners will want to learn defence as well, so they will need you to provide an offensive challenge. Trust that your trainer will keep the intensity of your efforts in check.
Most good coaches will not let you spar until you have at least a rudimentary grasp of the basics and will gradually expose you to more intense sessions as you become more skilled and conditioned. It's not a process to be rushed, and one that can be conducted with a fair degree of safety for both fighters.
Regular sparring contains considerable risk of not just minor injury, but Chronic Traumatic Encephalopathy
Sparring for recreational fighters is in my opinion best performed lightly, where the emphasis is on technique, strategy and movement rather than damage. Don't get sucked into a macho environment where 'being tough' is associated with being silly enough to fight on despite repeated concussive blows (this isn't common in good gyms, but the warning is worthwhile).
As for being over 50, boxing can offer an excellent physical and mental regime. Consult a doctor and get a medical check if you are overweight or have any concerns about your health.
Lastly, many trainers know a lot about boxing but little about exercise physiology, especially how it relates to the often unique demands of older athletes. Emulate the tortoise rather than the hare and have confidence in your ability to read warning signs of injury or overexertion. Push yourself, but don't let yourself be pushed beyond what feels safe.
Otherwise, go for it. The benefits can be wonderful.
Good luck.