By the time we reached the restaurant, our friends had already booked a table.
В придаточном предложении используется Past Simple, а более раннее действие выражается Past Perfect.