You could set approval-process locks and unlocks only through the Salesforce user interface. Follow these steps to enable this feature:
Go to Setup -> enter Process Automation Settings in the Quick Find box -> Select Process Automation Settings.
Select Enable record locking and unlocking in Apex.