Thanks for your query,based on the facts that you have posted it appears that you have developed infection of the penis due to unprotected sex and possibility of acquiring STD
can nt be ruled out .
Please go ahead and get basic STD test ans swab test done to rule out STD.
In the mean while start taking broad spectrum antibiotics like Cefotaxime
along with anti inflammatory medication like Diclofenac
twice daily .
Ensure to clean your genitals with warm water twice daily,