Exhibit 10.4

EXECUTION COPY

GOLDMAN SACHS MORTGAGE COMPANY

200 WEST STREET

NEW YORK, NEW YORK 10282-2198



March 13, 2011

VIA FEDERAL EXPRESS

KBS GKK Participation Holdings I, LLC

c/o KBS
Capital Advisors LLC

620 Newport Center Drive, Suite 1300

Newport Beach, CA 92660

Telephone: 949-417-6563

Facsímile: 949-417-6518

Attention: David
E. Snyder, Chief Financial Officer

Re: Amendment #1 to Extension Agreement (this Amendment)

Ladies and Gentlemen:

We
refer to the Extension Agreement, dated March 9, 2011 (the Extension Agreement), by and between KBS GKK Participation Holdings I, LLC (the Seller) and Goldman Sachs Mortgage Company (the
Buyer) relating to the Master Repurchase Agreement, dated as of August 22, 2008 (as amended and modified by the Extension Agreement, the Repurchase Agreement), by and between Seller and Buyer. Capitalized
terms not defined herein shall have the meanings set forth in the Repurchase Agreement and if not defined therein shall have the meanings set forth in the Intercreditor Agreement, dated as of August 22, 2008 (the Intercreditor
Agreement), by and among Citigroup Financial Products Inc. (Citi), Buyer, SLG Stars Mortgage Loan LLC, and SLG Stars Mezz Loan LLC.

Seller requested that Buyer enter into the Extension Agreement to extend the Termination Date as provided therein. Seller has requested Buyer to agree to amend the Extension Agreement. Now, therefore,
Buyer and Seller agree as follows:



| | 1. | Amendment to Extension Agreement The parties hereto hereby agree that Paragraph 1(a) of the Extension Agreement is amended by inserting the
following as a new paragraph immediately after the first paragraph of Paragraph 1(a):
| | -- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

If all conditions precedent under Paragraph 1 of the Omnibus Extension of Loan Agreements, dated March 13,
2011 (the Omnibus Extension), by and among the borrowers under each of the Senior Loan, the Senior Mezzanine Loan and the Junior Mezzanine Loan,



---

Gramercy Capital Corp., GKK Stars Junior Mezz I, LLC, Goldman Sachs Mortgage Company, Citicorp North America, Inc., KBS GKK Participation Holdings I, LLC ; KBS GKK Participation Holdings II, LLC
and SL Green Realty Corp., have been satisfied in Buyers sole determination, (A) the Termination Date shall be extended until 11:59 p.m. (New York time) on April 22, 2011, and (B) the Short Term Extension Period
shall mean the period from March 9, 2011 until 11:59 p.m. (New York time) on April 22, 2011.



| | 2. | Amendment to Extension Agreement The parties hereto hereby agree that Paragraph 1(a) of the Extension Agreement is amended by deleting the
words to have paid from clause (ii) of the last paragraph of Paragraph 1(a) of the Extension Agreement.
| | -- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



| | 3. | Amendment to Extension Agreement The parties hereto hereby agree that Paragraph 3(a) of the Extension Agreement is amended by inserting the
following text at the end of Paragraph 3(a):
| | -- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

To the extent Seller or any affiliate
acquires the equity in the Senior Mezzanine Borrower or any subsidiary of the Senior Mezzanine Borrower or acquires any rights to exercise any vote or action therewith, Seller shall not take any action therewith without Buyers prior written
consent. Seller agrees that any proceeds of the Senior Mezzanine Loan and/or of the participation constituting the Initial Transaction Asset under the Repurchase Agreement (the Participation), including without limitation the
equity in the Senior Mezzanine Borrower or any subsidiary of the Senior Mezzanine Borrower, shall be delivered to Buyer or its designee endorsed in blank and shall be included in the Transaction Asset under the Repurchase Agreement. For the
avoidance of doubt, references in this Extension Agreement to the Senior Mezzanine Loan and/or the Participation include proceeds thereof. 



| | 4. | Upon written request to Buyer from Seller, Buyer shall, within two (2) business days following receipt of such written request, confirm in
writing to Seller whether all conditions precedent under Paragraph 1 of the Omnibus Extension have been satisfied in Buyers sole determination and therefore whether the Termination Date has been extended to April 22, 2011, subject to the
provisions of Paragraph 1(a).
| | -- | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



| | 5. | The Extension Fee received by Buyer and Citi under the Omnibus Extension shall be applied by Buyer and Citi for application on account of
Buyers and Citis fees, costs and expenses under the Repurchase Agreement and the Citi Repurchase Agreement.
| | -- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



2



---

| | 6. | From and after the effective date of this Amendment, references in the Extension Agreement to this Extension Agreement,
hereof, or hereunder, or words of like import, shall be deemed to mean the Extension Agreement, as amended by this Amendment.
| | -- | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This Amendment may be executed in any number of separate counterparts and by the different parties hereto on 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. In proving this Amendment in any judicial proceedings, it shall not be necessary to produce or account for more than one such counterpart signed by the party against whom such
enforcement is sought. Any signature delivered by a party by facsimile transmission or electronic mail shall be deemed an original signature hereto. This Amendment shall be governed by the internal laws of the State of New York (including, without
limitation, Section 5-1401, et seq, of the New York General Obligations Law, but otherwise without regard to the provisions thereof regarding conflicts of law). The provisions of Section 12.10 (Submission to Jurisdiction; Waivers) and
Section 12.11 (Waiver of Jury Trial) of the Repurchase Agreement are hereby incorporated in this Amendment by this reference as if fully set forth herein (except that references therein to the Repurchase Agreement shall be deemed to be
references to this Amendment).

Subject to the terms hereof, Seller hereby (1) unconditionally ratifies and confirms,
renews and reaffirms all of its obligations under the Transaction Documents, the Transfer Documents, the Security Documents and the Repurchase Agreement and each of the other related documents referenced therein and (2) acknowledges and agrees
that such obligations remain in full force and effect, binding on and enforceable against it in accordance with the terms, covenants and conditions of the Transaction Documents, the Transfer Documents, the Security Documents, the Repurchase
Agreement, and the Extension Agreement as amended hereby, without impairment.

Subject to the terms hereof, Guarantor hereby
(1) unconditionally ratifies and confirms, renews and reaffirms all of its obligations under the Parent Guaranty and (2) acknowledges and agrees that such obligations remain in full force and effect, binding on and enforceable against it
in accordance with the terms, covenants and conditions thereof, without impairment.

Except as set forth herein, Buyer
expressly reserves any and all rights and remedies available to Buyer under the Repurchase Agreement, the Transaction Documents, the Transfer Documents, the Security Documents and the Participation Agreement, at law and in equity. No delay, waiver
or failure to exercise by Buyer in exercising any right, remedy, power or privilege hereunder or under the Repurchase Agreement, the Transaction Documents, the Transfer Documents, the Security Documents or the Participation Agreement shall preclude
any other or further exercise thereof, or the exercise of any other right, remedy power or privilege. Seller acknowledges and agrees that no oral communication or course of dealing from or on behalf of Buyer shall constitute any waiver, agreement,
commitment, or evidence of any assurance or intention of Buyer with respect to the Repurchase Agreement, the Transaction Documents, the Transfer Documents, the Security Documents or the Participation Agreement and the transactions contemplated
thereunder, and that any waiver, agreement,



3



---

commitment, assurance, or intention of Buyer with respect to thereto shall be effective only if in writing and duly executed by Buyer. The execution, delivery and effectiveness of this Amendment
does not constitute a waiver of any Default or Event of Default. Each of the Repurchase Agreement, the Transaction Documents, the Transfer Documents, the Security Documents and the Participation Agreement is and shall remain in full force and
effect, and all of the terms and provisions of the Repurchase Agreement, the Transaction Documents, the Transfer Documents, the Security Documents and the Participation Agreement are hereby ratified and reaffirmed. Except as expressly set forth
herein, nothing contained herein shall be construed or interpreted as a modification or amendment of the Repurchase Agreement, the Transaction Documents, the Transfer Documents, the Security Documents or the Participation Agreement in any way. Time
shall be of the strictest essence in the performance of the Sellers obligations hereunder.

[SIGNATURE PAGES FOLLOW]



4



---

IN WITNESS WHEREOF, for good and valuable consideration, the sufficiency of which is hereby acknowledged and
agreed, the parties hereto have executed and delivered this Amendment as of the date first hereinabove set forth.



BUYER:GOLDMAN SACHS MORTGAGE COMPANY, a New York limited partnershipBy:

Goldman Sachs Real Estate Funding Corp., its general partnerBy:

/s/ Mark J. BuonoName:

Mark J. BuonoTitle:

Authorized Signatory


[AMENDMENT TO EXTENSION AGREEMENT]



---

AGREED AND ACCEPTED:SELLER:KBS GKK PARTICIPATION HOLDINGS I, LLC, a Delaware limited liability companyBy: KBS DEBT HOLDINGS, LLC, a Delaware limited liability company, its sole memberBy: KBS LIMITED PARTNERSHIP, a Delaware limited partnership, its managerBy: KBS REAL ESTATE INVESTMENT TRUST, INC., a Maryland corporation, its sole general partnerBy:

/s/ David E. SnyderName:

David E. SnyderTitle:

Chief Financial Officer




GUARANTOR:KBS REAL ESTATE INVESTMENT TRUST, INC.,a Maryland corporationBy:

/s/ David E. SnyderName:

David E. SnyderTitle:

Chief Financial Officer


[AMENDMENT TO EXTENSION AGREEMENT]