This sounds like balanitis, maybe, which is not an STD. Is it only swollen at the meatus, or is the area around it red and irritated, too?
There is no risk for an STD from a handjob and rubbing breasts or massage.
You need to see a doctor to see what this is. Even if it's balanitis, it can be caused by a bacteria or a fungus, and the treatment for those are really different. Don't try to treat it yourself.
Let us know what happens.