I had sex with a prostitute for a minute and without knowing wore upside down condom. When I removed my fingernail tore the condom. Any HIV risk?

A small risk. There is a very very small risk of HIV transmission with a condom. Not wearing the condom properly slightly increases the risk but it is still very very small. Tearing the condom while removing probably doesnt cause any increased risk. Please be more careful , and consider getting tested .