You will not be allowed to register your residential address on a expired visa. A valid passport and residence permit are required to officially marry in Germany. The office responsible for this is called the Standesamt. Additionally, you will need to provide a certificate of single status from your home country, as German law permits only one marriage at a time.
Just so you know. If authorities suspect a sham marriage, the municipality conducts investigations. You and your partner are interviewed separately about your relationship. These investigations involve cooperation with the police and immigration authorities. Providing false information during the interview may result in imprisonment.