Hello Pedro,
Thank you for visiting Microsoft Community.
As per the description, I understand that you want to schedule Windows update to be downloaded and installed during night at 1 AM. You want to know whether you need to have it switched on and user profile unlocked to have the updates installed at their scheduled time.
To answer your question, it's absolutely fine to keep your computer locked at the time of scheduled update installation. You need to have your computer switched on but it doesn't require you to be logged on.
For more information you may refer the Microsoft article below:
Change how Windows installs or notifies you about updates
Hope this information is helpful. Feel free to write us back for any further assistance with Windows, we'll be glad to assist you.