UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1o+QLd60lgBnBAeX3R/m822WNKDkkatopVRwH4tkI9M=' 
WHERE 
  key_id = '2e3dcdda399a4e9047e829e1bb317c7f9d13636ff960b7af0aa64b43618c7903' 
  AND (
    token = '1o+QLd60lgBnBAeX3R/m822WNKDkkatopVRwH4tkI9M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028