Yes, I know this process is horrible, but there is currently no wayaround it
Important Notice
This process is cloud based, which means that Xiaomi can change therules for old devices retroactively It also means that you need aXiaomi account
Instructions
Download the Mi Unlock tool. Older versions will almost certainly not work with Xiaomi's cloud infrastructure, so download the lastest one from Xiaomi's website
Sign into your Xiaomi account on the phone
Enable developer settings (by pressing "Settings" > "About device" > "OS version" 7 times)
Go to "Settings" > "System" > "Developer settings" > "OEM Unlocking" > "Link account"
This will require you to install a SIM card and disable WiFi
Put the phone into fastboot mode by holding "volume -" while it'sbooting
It's important to press "volume -" before you press the powerbutton. Otherwise you might boot into "fastbootd", which is adifferent thing
Sign into your Xiaomi account in the app
Press "Unlock"
The app may require you to wait up to a week before unlocking. This isrequired and cannot be changed
The phone has to be mostly online in that time and always have the SIMcard installed
highghlow