I have a table which gets lots of calls(about 30/sec) lets call it `service`.

`service` build as the following 

```
`id`|`name`|`lastUpdate`|`inUse`|`usedBy`

```

While I change one of the rows I don't want it to be shown in any other select\update statements till the update is finished. 
for example-

session 1:

```
UPDATE `service` SET `inUse`=1, `usedBy`='xxx' 
WHERE `inUse`=0 ORDER BY `lastUpdate` ASC LIMIT 1

```

session 2 :

```
UPDATE `service` SET `inUse`=1, `usedBy`='xxx' 
WHERE `inUse`=0 ORDER BY `lastUpdate` ASC LIMIT 1

```

despite both queries run in same moment I want them to update different rows.

I know there's some articles about this question, but for some reason each one got different answer, probably it changed over the years..
I'm working with doctrine but I don't mind to work with regular mysql solution