UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lx9WIPYT67LKGMlviPDw+k89YdhsrZguWqP1GTJC+Vc=' 
WHERE 
  key_id = '99f3aa39d834cb9a107e668557694f388a13f7f08c9ec1f09eba63caf12fd9fa' 
  AND (
    token = 'Lx9WIPYT67LKGMlviPDw+k89YdhsrZguWqP1GTJC+Vc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00073