That’s exactly how you do it. I’ve rubbed one out with at least half of my guy friends, even ones who aren’t in the least bit curious, and this is exactly how it’s done. I’m in my mid 30s and this still happens. I also have numerous friends that I trade pics and vids with - sometimes it’s us with our wives/girlfriends and sometimes it’s just solo stuff. I even have two or three that are comfortable with ass play during a bate sesh or sending pics/vids of it to each other.
You just gotta go for it in a nonchalant way, with far less conversation than you’re probably thinking. If he stays around when you put the porn on, there’s a 90% chance he’s down to get your dicks out. You’re probably gonna have to go first though. Just put on the porn, give it a minute, then put your hand in your pants without saying anything and start playing with yourself (keep your eyes on the screen - don’t look at him yet). He will likely be fine with this, even if he’s in that 10% that will freak if you pull your dick out. Give it another minute or two and then unbutton your pants to make it easier but don’t get your dick out. DON’T LOOK AT HIM. (He will probably be secretly looking at you though)
If at some point during all that he starts doing the same thing, you don’t need to have a conversation about pulling your dick out. Just do it. Don’t stand up and drop your pants though, just pull them down enough to get your dick out, like you’re taking a piss. He will very likely follow your lead. Then you can get the pants all the way off. And once your dick is out, you can look at him.
If he never puts his hands in his pants, you’ll need to say something like “I gotta get this boner out of these jeans, you cool if I rub one out?” And then improvise from there based on his response and general reactions as things progress. If he says no, drop it and shut off the porn.
It may take more than one session to get where you’re wanting to be, but you gotta let those sessions happen naturally - don’t suggest it outright - and then just play it all by ear.