Can happen any time after 31 inclusive.
They normal anunce retirement in the last year of contract, at least with me.
I had a player that the contract finished with 33 and he did not retired, that only happened with 34.