This is called a race condition, where you have multiple scripts running at the same time competing for the same file or data base entries. In the case of an auction, every bid is merely an insert of a record into a database. It doesn't matter which one gets there first... the database engine will keep a database row of order. For example:
table bids {
id,
user,
bid_amount,
time
}
The timestamp can be accurate down to the second, no need for milliseconds, because this query:
SELECT * FROM bids ORDER BY bid_amount DESC, time, id
will place them in order of most expense first, then if two bid_amounts are equal, the earliest one comes next. If two are of the same bid_amount and time, then the database will order them in the order in which they were inserted into the database. The database engine will not insert two records at the same time. Each insert has a unique 'id' - so the earlier bid is the bid with the lower id.
Pretty easy for the developer.... no need to worry about a race condition, you can let the database engine handle that problem, and it will handle it very well.