In most cases the corneal transplant will last forever or until you die one day.
That is as long as the corneal transplant is not rejected by your body which can sometimes happen but that doesn't usually happen for at least 20 years.
So sometimes people may need a corneal transplant again after 20 years if your body rejects the current corneal transplant eventually.
But rarely does a corneal transplant get rejected by your body and most corneal transplants due work successfully for most people.
Also you're awake during the corneal transplant however you'll be given an anesthetic injection around the eye to prevent your eyes form moving and to numb the area where you'll not feel any pain.