he is likely having some irritation involving his penis and needs a good urinalysis done, it could be crystals &/or a UTI (urinary tract infection) both need to be treated asap. male cats are especially prone to crystals especially as they age....always always feed male cats WET food, not dry....wet food is needed to keep their PH within normal range of under 7 and prevent crystals forming. please get your Vet to check for both these conditions