ORA-30006 and ORA-00054 errors raised when update operation is performed against a record, that has been locked by the user or some session FOR UPDATE.
To fix this, before performing the update, check whether the record is locked or not. Simple way to check this is,
select invoice_num into l_invoice_num
where invoice_num = 'TEST123'
for update skip locked;
<do your update process against the invoice in AP_INVOICES_ALL table>;
<do not perform update>;
The select script will return NO_DATA_FOUND exception, if invoice number 'TEST123' is locked FOR UPDATE and will exit the update process.