Assuming you are using a database, it's a fairly simple UPDATE query:
UPDATE MyTable SET inStock = inStock - 1 WHERE BookID=TheIdForTheBookHeBorrowed
It would probably be a good idea to include the whole thing in a stored procedure if you can, or at the least within an SQL Transaction.