The Marantec 382 2-Button Remote is the correct replacement.
https://www.garagedoorzone.com/382-Digital-2-Button-Marantec-Garage-Door-Opener-Remote_p_255.html
If your current M3-2312 remote is working then you will use it to transfer the code from it to the new remotes using the included 3-prong Programming Connector.