UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Itr7QRqQ54l3LLYmLM0AV/dzJ+kBgUyZPbV44Y6zeYw=' 
WHERE 
  key_id = '4a773d30c3f1cead8eb915c312f8cd480c5553120f0bfb789e7abbaf894e5834' 
  AND (
    token = 'Itr7QRqQ54l3LLYmLM0AV/dzJ+kBgUyZPbV44Y6zeYw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030