Exhibit 10.31


 


FIFTH AMENDMENT TO SECOND AMENDED AND
RESTATED 


CREDIT AGREEMENT


 


This FIFTH AMENDMENT
TO SECOND AMENDED AND RESTATED CREDIT AGREEMENT (this “Amendment”), dated as of February 26, 2016 (the “Effective
Date”), is entered into by and among PACIFIC ETHANOL HOLDING CO. LLC, a Delaware limited liability company (“Pacific
Holding”), PACIFIC ETHANOL MADERA LLC, a Delaware limited liability company (“Madera”), PACIFIC ETHANOL
COLUMBIA, LLC, a Delaware limited liability company (“Boardman”), PACIFIC ETHANOL STOCKTON LLC, a Delaware
limited liability company (“Stockton”), and PACIFIC ETHANOL MAGIC VALLEY, LLC, a Delaware limited liability
company (“Burley” and, together with Pacific Holding, Madera, Boardman and Stockton, the “Borrowers”),
Pacific Holding, as Borrowers’ Agent, PE OP CO., a Delaware corporation (f/k/a New PE Holdco LLC), as Pledgor (the “Pledgor”
and together with Borrowers and Pacific Holding as Borrower’s Agent, the “Borrower Parties”), each of
the Lenders, WELLS FARGO BANK, N.A., as administrative agent for the Lenders (“Administrative Agent”), and
WELLS FARGO BANK, N.A., as collateral agent for the Senior Secured Parties (“Collateral Agent”). Capitalized
terms used but not otherwise defined herein shall have the meaning ascribed to such terms in the Credit Agreement (as hereinafter
defined).


 


RECITALS


 


WHEREAS, the
Borrower Parties, the Lenders party thereto, Administrative Agent, Collateral Agent, and Accounts Bank, entered into that certain
Second Amended and Restated Credit Agreement dated as of October 29, 2012 (as amended to date, the “Credit Agreement”);


 


WHEREAS, pursuant
to the Credit Agreement, three separate commitments were extended to the Borrowers, a Tranche A-1 Term Loan, a Tranche A-2 Term
Loan and a Revolving Loan, all as further described in the Credit Agreement, including Sections 2.01 through 2.03 thereof;


 


WHEREAS, the Revolving
Loan Commitment has been terminated and each of the Revolving Lenders have ceased being Lenders under the Credit Agreement;


 


WHEREAS, Credit
Suisse Loan Funding LLC (“Credit Suisse”) and Pacific Ethanol, Inc. constitute 100% of the Tranche A-1 Lenders;


 


WHEREAS, Pacific
Ethanol, Inc. constitutes the sole Tranche A-2 Lender;


 


WHEREAS, the Borrowers
desire to prepay 100% of the Tranche A-1 Term Loans and other Obligations held by Credit Suisse (the “Loan Prepayment”),
and Credit Suisse has agreed to waive any Make-Whole Amount due and payable in connection with the Loan Prepayment; and


 


WHEREAS, following
the Loan Prepayment, Pacific Ethanol, Inc. shall constitute the sole Lender under the Credit Agreement and desires to amend and
modify the Credit Agreement as set forth herein;


 


NOW, THEREFORE,
for good and valuable consideration, the receipt and adequacy of which is hereby acknowledged and confirmed, the parties hereto
hereby agree as follows:


 





	SECTION 1.	Consent
and Waiver Regarding Prepayment. As of the date hereof, the following amounts are due (collectively, the “Prepayment
Amount”): (A) the principal amount of Tranche A-1 Term Loans held by Credit Suisse in an amount equal to$17,003,037.06;
(B) the accrued interest in respect thereof through February 23, 2016 in an amount equal to $156,790.30, with interest accruing
after February 23, 2016 at the per diem rate of $6,271.61 until payment in full is received; and (C) the accrued but unpaid fees
and costs of Administrative Agent and Collateral Agent, including its attorneys fees and costs, in an amount equal to $52,757.16
(the “Agent Fees”). Notwithstanding any provision of the Credit Agreement, (i) each of the Lenders hereby consents
to the Borrowers’ effecting the Loan Prepayment by (x) paying to Credit Suisse on the date hereof an amount equal to the
Prepayment Amount (less the Agent Fees) without any requirement that such prepayment be made in accordance with any waterfall provision
in the Credit Agreement or any portion thereof otherwise be distributed to any other Lender, and (y) paying to the Administrative
Agent on the date hereof an amount equal to the Agent Fees, and (ii) Credit Suisse hereby waives any and all prepayment premiums
or other amounts (other than the Prepayment Amount) due and payable to Credit Suisse (including, without limitation, the Make-Whole
Amount provided by Section 3.15 of the Credit Agreement) in connection with the Loan Prepayment. Each of the Administrative Agent
and the Lenders waives any notice requirement in connection with such Loan Prepayment. In addition to the Prepayment Amount, Borrowers
will be obligated to, and shall promptly, pay Administrative Agent’s and Collateral Agent’s fees and reasonable, out-of-pocket
fees and costs related to this Amendment and the consummation thereof (including the fees and costs of the Administrative Agent’s
and Collateral Agent’s counsel).
	 	 	 



 


 






    	 	1	 



     

    

 


	SECTION 2.	Amendments.
The Credit Agreement is hereby amended as follows:
	 	 
	 	2.1	Section
10.06(b) of the Credit Agreement is hereby amended and restated to read as follows:
	 	 	 
	 	“(b)Upon
any notice of resignation by any Agent or upon the removal of any Agent by the proper Persons pursuant to Section 10.06(a), the
Required Lenders of the Revolving Loan Class and the Required Lenders of the Tranche A-1 Term Loan Class shall appoint a successor
Collateral Agent or Administrative Agent, as applicable, hereunder and under each other Financing Document, or the Required Lenders
of the Revolving Loan Class, the Required Lenders of the Tranche A-1 Term Loan Class and the Required Senior Lenders shall appoint
a successor Accounts Bank.”
	 	 	 
	 	2.2	Section
10.06(c) of the Credit Agreement is hereby amended and restated to read as follows:
	 	 	 
	 	“(c)If no successor
Agent has been appointed by the proper Persons under Section 10.06(b) within thirty (30) days after the date such notice of resignation
was given by such Agent or the proper Persons elected to remove such Agent under Section 10.06(a), and provided that no Default
or Event of Default has occurred and is continuing, the Borrowers may appoint a replacement Agent within the immediately succeeding
fifteen (15) days.”



  





	SECTION 3.	Payment
of Costs and Fees. Each Borrower (i) reaffirms its obligations under Section 11.07 of the Credit Agreement and (ii) without
limiting the provisions set forth in Section 11.07 of the Credit Agreement, acknowledges, consents and agrees that it shall promptly
pay, upon receipt of invoices therefor, to the Administrative Agent, the Collateral Agent and each Lender all reasonable out-of-pocket
costs, fees, expenses and charges of every kind in connection with the preparation, negotiation, execution and delivery of this
Amendment incurred by or on behalf of such Persons, including, without limitation, the reasonable fees and disbursements of Kelley
Drye & Warren LLP, counsel to the Administrative Agent and the Collateral Agent.
	 	 	 



 






    	 	2	 



     

    

 


	SECTION 4.	Acknowledgements.
	 	 
	 	4.1.	Reaffirmation of Obligations.
Each Borrower Party hereby (a) reaffirms, acknowledges, confirms and agrees to its respective guarantees, pledges and grants of
security interests and other commitments and Obligations under the Financing Documents and (b) confirms and agrees that the Financing
Documents and all guarantees, pledges and grants of security interests and other commitments and Obligations thereunder shall continue
to be in full force and effect following the effectiveness of this Amendment. All Obligations under the Credit Agreement and the
other Financing Documents owing by the Borrower Parties to the Administrative Agent, the Collateral Agent, the Accounts Bank and
each Lender, as the case may be, are unconditionally owing by the Borrower Parties to the Administrative Agent, the Collateral
Agent, the Accounts Bank and each Lender, as the case may be, without offset, defense or counterclaim of any kind, nature or description
whatsoever.
	 	 	 
	 	4.2.	Acknowledgement of Security Interests. Each Borrower Party hereby acknowledges, confirms and agrees that the Collateral
    Agent, for itself and the benefit of Senior Secured Parties, has and shall continue to have valid, enforceable and perfected
    first-priority liens (subject only to Permitted Liens) upon and security interests in the Collateral granted to the Collateral
    Agent, for itself and the benefit of Senior Secured Parties, pursuant to the Financing Documents.
	 	 	 
	 	4.3.	Binding Effect of Documents.
Each Borrower Party hereby acknowledges, confirms and agrees that: (i) each of the Financing Documents to which it is a party has
been duly executed and delivered to the Administrative Agent, the Collateral Agent, the Accounts Bank and the Lenders party thereto
by it, and each is in full force and effect as of the Effective Date, (ii) the agreements and obligations of such Borrower Party
contained in the Credit Agreement, in each of the other Financing Documents and in this Amendment constitute the legal, valid and
binding obligations of such Borrower Party, enforceable against such Borrower Party in accordance with their respective terms,
and such Borrower Party has no valid defense to the enforcement of the obligations under the Credit Agreement or the other Financing
Documents, except as enforceability may be limited by bankruptcy, insolvency, moratorium, reorganization or other similar laws
limiting creditors rights generally and except as enforceability may be limited by general principles of equity (regardless of
whether such enforceability is considered in a proceeding in equity or at law) and (iii) the Administrative Agent, the Collateral
Agent, the Accounts Bank and each Lender are and shall be entitled to the rights, remedies and benefits provided for in the Financing
Documents and under applicable law or at equity.



 





	SECTION 5.	Representations
and Warranties of Borrower Parties. Each of the Borrower Parties hereby represents and warrants in favor of the Administrative
Agent, the Collateral Agent, the Accounts Bank and each Lender as follows:
	 	 	 
	 	5.1.	The execution, delivery
and performance by such Borrower Party of this Amendment are within such Borrower Party’s powers and have been duly authorized
by all necessary action on the part of such Borrower Party.
	 	 	 



 



    	 	3	 



     

    

 


	 	5.2	This Amendment has been
duly executed and delivered by such Borrower Party and this Amendment constitutes a legal, valid and binding obligation of such
Borrower Party enforceable in accordance with its terms except as enforceability may be limited by bankruptcy, insolvency, moratorium,
reorganization or other similar laws limiting creditors rights generally and except as enforceability may be limited by general
principles of equity (regardless of whether such enforceability is considered in a proceeding in equity or at law).
	 	 	 
	 	5.3.	The execution, delivery
or performance of this Amendment by such Borrower Party (i) does not require any consent or approval of, registration of filing
with, or any other action by, any Person (including, without limitation, any Governmental Authority) except such as have been obtained
or made and are in full force and effect, (ii) will not violate the organizational or governing documents of any Borrower Party
and (iii) will not violate any applicable Law or any Contractual Obligation applicable to or binding upon such Borrower Party or
any of their respective properties or assets.
	 	 	 
	 	5.4.	No event has occurred or
is continuing, that would constitute a Default or an Event of Default under the Credit Agreement or any other Financing Document.
	 	 	 
	 	5.5.	As of the Effective Date
no litigation by, investigation known to such Borrower Party by, or proceeding of, any Governmental Authority is pending or, to
the knowledge of such Borrower Party, has been threatened against such Borrower Party which (i) challenges such Borrower Party’s
right, power, or competence to enter into this Amendment or perform any of its obligations under this Amendment or the validity
or enforceability of this Amendment or any action taken under this Amendment or (ii) is reasonably likely, if adversely decided,
to have a Material Adverse Effect.
	 	 	 
	 	5.6.	After giving effect to
this Amendment, the representations and warranties of such Borrower Party contained in the Credit Agreement and the other Financing
Documents are true and correct in all material respects (provided, that if any representation or warranty is by its terms qualified
by concepts of materiality, such representation shall be true and correct in all respects) on and as of the Effective Date with
the same effect as if such representations and warranties had been made on and as of such date, except that any such representation
or warranty which is expressly made only as of a specified date need be true only as of such date.



 


	SECTION 6.	Conditions
to Effectiveness of this Amendment. This Amendment shall be effective only (i) if and when signed by, and when counterparts
hereof shall have been delivered to the Administrative Agent (by hand delivery, mail, telecopy or other electronic transmission)
by, the Borrower Parties and the Lenders, and (ii) when the Borrower Parties shall have paid (A) an amount equal to the Prepayment
Amount (less the Agent Fees) to Credit Suisse, and (B) an amount equal to the Agent Fees to the Administrative Agent.
	 	 	 



 



    	 	4	 



     

    




	SECTION 7.	Effect
on the Financing Documents.
	 	 	 
	 	7.1.	Except
as set forth in this Amendment, the Credit Agreement and each of the other Financing Documents shall be and remain unchanged and
in full force and effect in accordance with their respective terms, are hereby ratified and confirmed in all respects and the Administrative
Agent, the Collateral Agent, the Accounts Bank and each Lender expressly reserves the right to require strict compliance with the
terms of the Credit Agreement (and, following the Effective Date, the Credit Agreement, as amended by this Amendment) and the other
Financing Documents. The execution, delivery, and performance of this Amendment shall not operate as a modification or waiver of
any right, power, or remedy of any Agent or any Lender under the Credit Agreement (and, following the Effective Date, , the Credit
Agreement, as amended by this Amendment) or any other Financing Document and no such action shall be construed as (i) a waiver
or forbearance of any of the Administrative Agent’s, the Collateral Agent’s, the Accounts Bank’s or the Lenders’
rights, remedies, and powers against the Borrowers, any other Borrower Party or the Collateral or (ii) a waiver of any Default
or Event of Default. Notwithstanding any provision of this Amendment, nothing herein shall adversely affect the rights, remedies,
duties, liabilities, obligations and/or responsibilities of any Lender that has not consented to the terms hereof to the extent
such consent may be required pursuant to the Credit Agreement, including Section 11.01 thereof.
	 	 	 
	 	7.2.	Upon
and after the effectiveness of this Amendment, each reference in the Credit Agreement to “this Agreement,” “hereunder,”
“herein,” “hereof” or words of like import referring to the Credit Agreement, and each reference in the
other Financing Documents to “the Credit Agreement,” “thereunder,” “therein,” “thereof”
or words of like import referring to the Credit Agreement, shall mean and be a reference to the Credit Agreement as modified by
this Amendment.
	 	 	 
	 	7.3.	To
the extent that any terms and conditions in any of the Financing Documents shall contradict or be in conflict with any terms or
conditions of the Credit Agreement, after giving effect to this Amendment, such terms and conditions are hereby deemed modified
or amended accordingly to reflect the terms and conditions of the Credit Agreement as modified hereby (except to the extent that
such contradiction or conflict is expressly permitted by this Amendment).
	 	 	 
	SECTION 8.	Ratification.
Except as expressly modified hereby or waived herein, the Credit Agreement and the other Financing Documents shall be and remain
unchanged and in full force and effect in accordance with their respective terms, are hereby ratified and confirmed in all respects.



 


	SECTION 9.	Governing
Law. This Amendment shall be governed by, and construed and interpreted in accordance with, the laws of the State of New York,
without regard to conflicts of law principles that would require the application of laws of another jurisdiction.
	 	 
	SECTION 10.	Financing
Document. This Amendment shall be deemed to be a Financing Document for all purposes.
	 	 
	SECTION 11.	Severability.
Wherever possible, each provision of this Amendment shall be interpreted in such a manner as to be effective and valid under applicable
law, but if any provision of this Amendment shall be prohibited by or invalid under applicable law, such provision shall be ineffective
to the extent of such prohibition or invalidity, without invalidating the remainder of such provision or the remaining provisions
of this Amendment.
	 	 
	SECTION 12.	Counterparts.
This Amendment may be executed by one or more of the parties hereto on any number of separate counterparts, each of which shall
be deemed an original and all of which, taken together, shall be deemed to constitute one and the same instrument. Delivery of
an executed counterpart of this Amendment by facsimile or other electronic transmission shall be as effective as delivery of a
manually executed counterpart hereof.
	 	 
	SECTION 13.	Lender
Direction. Each of the undersigned Lenders hereby directs each of the Administrative Agent and the Collateral Agent to execute
and deliver this Amendment and to perform its respective obligations hereunder. The undersigned Lenders agree and direct that no
other document (including without limitation any opinion) is required in connection with this Amendment.
	 	 	 




 


[Signature Pages Follow]


 



    	 	5	 



     

    




 


IN WITNESS WHEREOF,
the parties hereto have caused this Amendment to be executed by their respective officers as of the day and year first written
above.


 


 


PACIFIC ETHANOL HOLDING CO. LLC, as a Borrower
and as Borrowers’ Agent


 


 


By:/s/ BRYON T. MCGREGOR


Name: Bryon
T. McGregor


Title: Chief
Financial Officer


 


PACIFIC ETHANOL MADERA LLC, as a Borrower


 


 


By:/s/ BRYON T. MCGREGOR


Name: Bryon
T. McGregor


Title: Chief
Financial Officer


 


 


PACIFIC ETHANOL COLUMBIA, LLC, as a Borrower


 


 


By:/s/ BRYON T. MCGREGOR


Name: Bryon
T. McGregor


Title: Chief
Financial Officer


 


 


PACIFIC ETHANOL STOCKTON LLC, as a Borrower


 


 


By:/s/ BRYON T. MCGREGOR


Name: Bryon
T. McGregor


Title: Chief
Financial Officer


 


 


PACIFIC ETHANOL MAGIC VALLEY, LLC, as a Borrower


 


 


By:/s/ BRYON T. MCGREGOR


Name: Bryon
T. McGregor


Title: Chief
Financial Officer


 


 


PE OP CO., as Pledgor


 


 


By:/s/ BRYON T. MCGREGOR


Name: Bryon
T. McGregor


Title: Chief
Financial Officer


 


 


WELLS FARGO BANK, N.A.,
as Administrative Agent and Collateral Agent


 


 


By:/s/ MICHAEL ROTH


Name: Michael
Roth


Title: V.P.


 





Signature Page to Amendment to Second
Amended and Restated Credit Agreement



 



    	 	 	 



     

    




 


The undersigned Lender
acknowledges and agrees that this signature page shall be fully valid and binding upon such Lender upon its execution and delivery
by such Lender to the Administrative Agent and may not thereafter be revoked, terminated or cancelled by such Lender.


 


 


Credit Suisse Loan Funding LLC, as Lender


 


 


By:/s/ ROBERT HEALEY


Name: Robert
Healey


Title: Authorized Signatory


 


 


By:/s/ MICHAEL WOTANOWSKI


Name: Michael
Wotanowski


Title:Authorized Signatory


 


 


 


 








Signature Page to Amendment to Second
Amended and Restated Credit Agreement











    	 	 	 



     

    

 


The undersigned Lender
acknowledges and agrees that this signature page shall be fully valid and binding upon such Lender upon its execution and delivery
by such Lender to the Administrative Agent and may not thereafter be revoked, terminated or cancelled by such Lender.


 


 


Pacific Ethanol, Inc., as Lender


 


 


By:/s/ BRYON T. MCGREGOR


Name: Bryon
T. McGregor


Title: Chief
Financial Officer


 


 


 


 


 








Signature Page to Amendment to Second
Amended and Restated Credit Agreement