I found some info here. I've copied it below
1.In http://developer.sonymobile.com/unlockbootloader/ choose Sony Xperia M2.
4.And unlock bootloader with intruction.
You get the code? Then we continue.
Download the latest version here or Flashtool http://www.flashtool.net/downloads.php
After installation, go the path C: \ Users \ username \ .flashTool \ registeredDevices here and create a folder with the code-name of your machine (you can find out if flashtool click on BLU and see where in the log are in line «Current device» for example, in line 09/045/2015 23:45:08 - INFO - Current device: C2104 - AB100C2DE3 - 1272-4136_R5B - 1269-5420_15.3.A.1.17 - WORLD-a_15.3.A.1.17 code machine will AB100C2DE3. Code which will write your name and location).
Later in this folder, create a text file and name it «ulcode» (without the quotes). Open, and in it write your unlock code, that you have on the site Sony.
Save. Write code very carefully.
Now open flashtool and press the BLU. If everything is correct, in line you should write your code, pressing unlock. All should be ready to unlock.
Yes, it is for the M5, not just the M3, at least it says in that post In the title, i sadly can't test it for you as I don't own one