I was asked this question by a Russian contact who said that there the corresponding figure was 43% (which sounds very high). I make it 32% here.
In essence we want to know something like
(size of age group)*(proportion of age group who are eligible to vote)*(proportion of eligibles who are registered to vote)*(proportion of registered voters who turn out)*(proportion of age group who are pensioners).
The ONS gives population by 5-year age bands; we can estimate the 18-19 population as 0.4*(15-19 population). An IPR blog posting gives eligibility and turnout among registered voters. As they say, this ignores the question of non-registration. It seems likely that those groups with lower turnout will be less likely to register in the first place. If we set (proportion of the eligible age group who vote) = (proportion of those registered in this age group who vote)^(1.14), this gives a total effective electorate that agrees with the number of votes cast in 2019 to within 0.5%. (Number of votes cast is given by Wikipedia.)
The corresponding figures are given in the table above. The table below now gives overall results.
Now then, a number of sources suggest (but without giving definite sources) that as of 2021, the average retirement age for men is 65.1, while the average retirement age for women is 64.
So taking an age of 65 as being near enough at this level of approximation, it seems that pensioners make up about 32% of the effective UK electorate, in the sense of those who actually vote in elections.
With a further assumption about the ‘average age’ of the various age bands, it is easy enough to estimate the mean age of voters (that is, people who actually vote in elections) as 54.72 years.