It's very tough to ask for a 40% increase because if you're that underpaid, your boss is unlikely to change tune now. Maybe they can't afford to pay you that much. Still, it happens.
Here's how I would do it:
Step 0a: Get Over It
Negotiating your salary is inherently adversarial. Nonetheless, it doesn't mean you won't be friendly or polite with your boss, or that he won't be the same with you after this is done.
That said, do not confuse being friendly with being your friend. This is a business transaction, and this is why it's inherently adversarial.
You may smile and laugh and reminesce about the old times, but behind that facade you must remember that he's trying to cheat you out of tens of thousands of $currency. Don't believe me? How many years do you plan to stay there? Multiply that by the 40% difference - that's the amount you stand to lose.
Step 0b: Plan
Figure out what would make you happy. Do you want the full 40% increase? Would another perk make up for some of it? A promotion, perhaps?
Write this plan down and make sure that, if you do get some alternatives, you're still happy and won't be resentful at letting an opportunity go by.
Remember, the final offer must be fair to you, not your current boss.
Step 1: Submit your Notice
This tells your boss you're serious and secures the offer you currently have. This is your position of strength from which your negotiation will happen.
Step 2: Negotiate
Tell him you really want to keep working here but are not happy leaving that much money on the table. This is pretty much what you wrote above.
I don't like to reveal my cards when negotiating and I wouldn't reveal the exact number. I would mention it's a high percentage and if a counter offer happens, I'd keep looking disappointed until I got what I wanted - or more.
But that's just me. If you're happy getting that 40%, or close to it (remember step 0b?) then you should go for it. If they can't give you the full amount, start asking for things that would make it up for you, those things that you thought about before.
And if it goes wrong, you can always walk away to your cozy new job.