I'm not sure. It is possible that it is some kind of beetle larva (Chrysomelidae family?) but I've never found anything like that. Still looking for correct ID.
It was alive. I'm 100% it wasn't Cordyceps. These horns reminded me something that is created by some sort of hemipterans, but of course this larva isn't true bug.