MySQL time-based constraint
===

I have an auction application with these two tables (this is highly simplified, obviously):

    create table auctions (
       auction_id int,
       end_time datetime
    );

    create table bids (
       bid_id int,
       auction_id int,
       user_id int,
       amount numeric,
       bid_time timestamp,
       constraint foreign key (auction_id) references auctions (auction_id)
    );

I don't want bids on an auction after that auction has ended. In other words, rows in the bids table should be allowed only when the bid_time is earlier than the end_time for that auction. What's the simplest way to do this in MySQL?