UPDATE billing_invoices
JOIN billing_invoice_items ON billing_invoice_items.parent_id = billing_invoices.id
SET billing_invoices.paid = billing_invoices.payable, billing_invoice_items.paid = billing_invoice_items.payable
WHERE billing_invoices.insurance_id != 13