UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pau+v0mT8jjmYqaCkyqAa0N4bMf+alLjCw8mRXSIQBg=' 
WHERE 
  key_id = '8f673e0663f7a8153e3c7960f0cd6a2e6e92ec9cc4c965d25d23818eeffa8a9b' 
  AND (
    token = 'pau+v0mT8jjmYqaCkyqAa0N4bMf+alLjCw8mRXSIQBg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028