I'm trying to implement a simple credit system, so I have a column "credits" in my user table, and I'd like to do the following with PHP/MySQL:

```
if (credits >= 1)  
  credits = credits - 1;
else 
  error(not_enough_credits);

```

Is it possible to do this in one query? Obviously, I could do a `SELECT` query on the credits, and if that is >=1 do an `UPDATE` to reduce the counter by one, but that could give concurrency issues.