(1) When a depositor stores a commodity with a warehouse operator or sells a commodity to a grain dealer, the depositor has a first priority statutory lien on the commodity or the proceeds therefrom or on commodities owned by the warehouse operator or grain dealer if the depositor has written evidence of ownership disclosing a storage obligation or written evidence of sale. The lien arises at the time the title is transferred from the depositor to the warehouse operator or grain dealer, or if the commodity is under a storage obligation, the lien arises at the commencement of the storage obligation. The lien terminates when the liability of the warehouse operator or grain dealer to the depositor terminates or if the depositor sells his or her commodity to the warehouse operator or grain dealer, then thirty days after the date title passes. If, however, the depositor is tendered payment by check or draft, then the lien shall not terminate until forty days after the date title passes.
(2) The lien created under this section shall be preferred to any lien or security interest in favor of any creditor of the warehouse operator or grain dealer, regardless of whether the creditor's lien or security interest attached to the commodity or proceeds before or after the date on which the depositor's lien attached under subsection (1) of this section.
(3) A depositor who claims a lien under subsection (1) of this section need not file any notice of the lien in order to perfect the lien.
(4) The lien created by subsection (1) of this section is discharged, except as to the proceeds therefrom and except as to commodities owned by the warehouse operator or grain dealer, upon sale of the commodity by the warehouse operator or grain dealer to a buyer in the ordinary course of business.