And that's each way... And, the chances of traffic being good in Boston, is slim to none. It's better now that the Big Dig is over and done with, but it is still not what I would consider to be good, especially since you need to drive up 93 to get to Salem. Depending what time you leave, it could take 45 minutes just to get out of the city. I have driven into and out of Boston on every route imaginable and at every time of day, and 95% of the time I hit traffic. Sometimes it's not bad, maybe delaying me 15 minutes, but I've also been delayed over an hour. I'm not trying to discourage you from going to Salem, as I love Salem, it's a great town, beautiful Old New England, with lots of history. And the traffic getting into Salem can be pretty bad, and Mid-September through October is the worst for since it's the height of tourist season in Salem.
Just a few things to think about. I don't know how much time you guys have in Boston, but if you really want to go to Salem, I would give yourself at least 2.5 hours to get back to the ship, and leave for Salem immediately upon docking. Traffic in Boston is awful and the drivers are scary (They don't call us Massholes for nothing. I would rather drive through NYC than drive through Boston any day of the week). Just know, that if the traffic is bad, you could be paying through the nose for a cab.