IAS39 requires such a deposit to be recognized as a financial asset and classified as loans & receivables.
Initially the security deposit has to be recorded at fair value plus transaction cost. To find the fair value you will have to discount the deposit at a market interest rate. For instance if you deposit $10,000/= as the security deposit which is refunded after two years, then assuming current market interest rate for a such a deposit at bank is 10%, the fair value of the deposit at the time of placing the deposit would be $7,513/=. This will be recorded as follows:
Dr-Security Deposit = 7,513
Dr-Deferred Rent Expense (B/S) = 2,487
(You may have the option of fully charge this amount to income statement in the first year itself)
Cr-Cash = 10,000
(Assumed that the transaction cost is immaterial/zero)
The subsequent measurement of loans & receivables should be at the amortized cost using the effective interest method which should ensure the amortised cost of a financial asset is the present value of future cash receipts discounted at the effective interest rate.
Therefore, over the period of the deposit, interest receivable will be added to the deposit account using the effective interest method. The interest income for a year equals the carrying amount of the loan (financial asset) at the beginning of a period multiplied by the effective interest rate for the period.
After the two years period your deposit account will get back to $10,000/= which will be set off against the refund of the deposit.
Just check out this example of accounting for security or refundable deposit.