UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/jfaUCSBhr8/uckIcMgXX74klEuxx0Cz8eQjjTtHvpc=' 
WHERE 
  key_id = '7c9d94e638215690b8fb2d884d67243878ac6561ee2ac6133bce24cc65e2bf47' 
  AND (
    token = '/jfaUCSBhr8/uckIcMgXX74klEuxx0Cz8eQjjTtHvpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029