Xiaomi Mi A1 How to change the screen lock code NOT the sim lock code
I am not on stock ROM on that device but as I recall Settings &rarr; Security ( and location?) &rarr; Device Security &rarr; Screen Lock. 

You need to enter your PIN to change screen lock