For the period of history, please see Middle Ages.
Middle age was the stage of life in which one had lived half their average life span. A suddenly realization of having reached that age could produce a midlife crisis.
In 2370, Data detected the life signs of, among others, two middle aged males on Camor V. (TNG: "Bloodlines")
In 2371, Julian Bashir noted to Elim Garak that "in many Human cultures, the thirtieth birthday is considered a sort of landmark. It marks the end of youth and the beginning of the slow march into middle age." (DS9: "Distant Voices")