Anal Cancer is farely unlikely, most cancers that occur in that region are prostate and colon cancer. Prostate cancer is very treatable if you catch it early. Colon cancer less so, it's what killed Fara Fawcett and from what I hear it is one of the most excruciating forms of cancer.
It is not usually a form of cancer that attacks younger people though. You should go see a doctor if the problem persists or worsen and you should probably have a prostate exam soon anyways.
BTW 30 is not old, and definitely don't let embarrassment keep you from life saving treatment.
There are plenty of causes for sharp sudden pain in the an us though, it is one of the most sensitive areas of the body, why do you think gays like it so much?
Hemroids, polyps, colitis, and a whole host of other medical reasons.