I made a similar decision prior to 2001...it was possible to justify it economically because of the higher pay scales at the major airlines.
A lot has changed since then...
Major airline hiring opportunities are low, there are in fact several thousand furloughed, included almost 2000 from the 9/11 furloughs.
All but three majors have had their pay, benefits, and QOL cut significantly (like 50%)...of course those three are the hardest to get hired at.
At age 40, that realistically leaves you regional airlines or corporate aviation as a career path.
Regionals are experiencing stagnant growth and some furloughs. No real adult could possibly live on regional FO pay for long, so you need to plan on a captain upgrade...historically 2-4 years is a good average, but right now it could be longer. Also the regionals with the best employment and upgrade opportunities are usually the worst companies to work for...you would not believe how poorly you will be treated until you experience it.
Corporate is a possibility, you can find liveable wages and working conditions at some jobs, but the pay and QOL range varies wildly. Some corporate pilots are on call 24/7...don't ever touch a beer, and don't go out of town. Corporate is ALL about who you know...agressive networking will be a required way of life to get into and thrive in that business. You will have to make your own opportunities at every turn.
At your age, assuming you have a family, I would not even consider it unless the house is paid for, the retirement account is fully funded, and you can pay for training and still have a survival fund to bridge the years of low pay until you can upgrade to CA.