UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tZjkKPTvnZJ3LKxXBe7xSa1gh3qUMbPT7zRjmd/1sV0=' 
WHERE 
  key_id = '05f94a7b3fe5c3b5f8a9a994f2056e5ff30b0124cd717498c2ea8a14cfbb4676' 
  AND (
    token = 'tZjkKPTvnZJ3LKxXBe7xSa1gh3qUMbPT7zRjmd/1sV0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044