UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ock5rizi7EVa0KsBacVILA2FGv0QLvV8rJf9TKCZeh4=' 
WHERE 
  key_id = 'f6a2403ea7f49e82dea73316d088ffa72acf85907f14036f9e3a829190ae0d40' 
  AND (
    token = 'Ock5rizi7EVa0KsBacVILA2FGv0QLvV8rJf9TKCZeh4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026