

Read about multiplexing. There are various ways to achieve it, the easiest way is to just arrange it on a grid. Let’s say 5×5. So with 10 pins, you can address 25 doors. For the lock, the easiest would be a solenoid / magnetic lock. You can also use a motor, but that would require a more complex addressing to reverse the rotation for opening and closing
Edit for more clarity about the simple method: Think of every door as a solenoid connected to GND. You only need VCC to open it. You can use relay module to switch the row and column to connect the VCC of the solenoid. But you need to wire every solenoid in “AND” switch configuration so it only turns on if and only if both row and column switch are closed

Where does it normally plug into? If it plugs into some sort of computing device, then yeah, one of them MAY be signal (probably LIN). If it could function with a simple switch however, then as the other said, try every combination possible.