This question is related to this one and this one. It also has a partial answer here and here.
In the third link the account is being unlocked for a period of time using web3.js:
web3.personal.unlockAccount("0x..", "<passs>", 1000);
The unlock period parameter is optional.
How is it possible to check if accounts are locked (prior to making transactions)?
Are there any functionality consequences of unlocking an already unlocked account?
let account = self.web3.eth.accounts.privateKeyToAccount(self.config.walletPrivateKey);
&self.web3.eth.personal.unlockAccount(account.address, account.privateKey, 200)