Does my wallet need to be unlocked to mine?
No, it doesn't have to be. Mining doesn't require private keys, only (part of) the public one. Having only the address of the destination is enough, so the wallet can be locked.