The master key is saved to the local database when you initiate encryption on your first device.
The other devices get the key from the data in your sync folder.
Even if you delete the SQL database, when other devices sync they will still discover the master-key in the sync folder.
The master key is not saved in an exported jex, so if you clean out your sync folder, and uninstall Joplin and remove config files on all devices and then reinstall, you can import your backed-up.jex for a clean start with no encryption.
You can then set up encryption again as you like.