Noted.

```sql
SELECT `sendgrid_­emailmessage`.­`id`,­ `sendgrid_­emailmessage`.­`message_­id`,­ `sendgrid_­emailmessage`.­`from_­email`,­ `sendgrid_­emailmessage`.­`to_­email`,­ `sendgrid_­emailmessage`.­`category`,­ `sendgrid_­emailmessage`.­`response`,­ `sendgrid_­emailmessage`.­`creation_­time`,­ `sendgrid_­emailmessage`.­`last_­modified_­time` FROM `sendgrid_­emailmessage` ORDER BY `sendgrid_­emailmessage`.­`id` DESC LIMIT ? FOR UPDATE
```

I think the solution is something like

```
self.select_for_update().values('pk').latest(field_name='pk')[0]["pk"] + 1
```