Hi,
If I understand the issue correctly, your laptop will go to sleep mode when you close the lid and when you open it back up it locks up right? Please do try adjusting the Power Option settings of your laptop.
- Open Power Options and click on Change plan settings on the select Power Plan then click on Change advanced power settings.
- Expand Hard disk then Turn off hard disk after and set it to Never.
- Expand Sleep then Allow hybrid sleep and set it to Off.
- Expand Hibernate after and set it to Never.
- Click Apply and OK then test it again.