Hello,
You could change your workflow so that it checks after the Approval if the contract is locked and if so loops back and sends the same Approve step back to the Approver and then includes extra text like: "Contract was locked, Approval not allowed at this time. Please try again later".
The code for checking if the contract was locked would be in a method of the relevant object/class, as Rob suggested.
regards
Rick