UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P0PUDJmJmTj1ZxJCcETxOIJGQrzyitArq5gGYoJXoFM=' 
WHERE 
  key_id = '3b6af7108b193089416584d9fb1e1c97a21666e3f5544bc1bb23725ca26fe6b9' 
  AND (
    token = 'P0PUDJmJmTj1ZxJCcETxOIJGQrzyitArq5gGYoJXoFM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058