(1) Except as provided in subsection (2) or (3) of this section, a bank may not exercise a right of recoupment or set off against a special deposit.
(2) An account agreement may authorize the bank to debit the special deposit:
(a) When the bank becomes obligated to pay a beneficiary, in an amount that does not exceed the amount necessary to discharge the obligation;
(b) For a fee assessed by the bank that relates to an overdraft in the special deposit account;
(c) For costs incurred by the bank that relate directly to the special deposit; or
(d) To reverse an earlier credit posted by the bank to the balance of the special deposit account, if the reversal occurs under an event or circumstance warranted under other law of this state governing mistake and restitution.
(3) The bank holding a special deposit may exercise a right of recoupment or set off against an obligation to pay a beneficiary, even if the bank funds payment from the special deposit.