Hello
I really appreciate your concern
Of course you need to be concerned but you need not to worry much about this
Looking at present condition you might have injured during the
masturbation or sex, may get infected if it was healthy previously.
another possibility is
prostate problem or chronic
urinary tract infection.
If I were your treating doctor, I would have advised you to keep it clean and apply antiseptic ointment
if it doesn't improve or worsens than I would have ordered few investigations like blood for
hemoglobin, CBC Liver and kidney function test, blood sugar and urine culture or an
ultrasound if need be.
you may require a course of anti allergic or antibiotics drugs under supervision of doctor
In my opinion Application of hot packs will help in healing
If it doesn't improve or gets worsen than you must see your doctor for physical check up and a course of antibiotics if need be.
Hope this answers your question
If you have any more queries please feel free to write back to me, I will gladly answer you
Best wishes