UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TXHdYAJ8v2Iisu+2h1gCMXtzGXVGxoyjZIlaH51UHXk=' 
WHERE 
  key_id = '2d67ef0573d23f015bdfcfab0e46a8b922d6c289f6ff6994d4754445b6d7ca7d' 
  AND (
    token = 'TXHdYAJ8v2Iisu+2h1gCMXtzGXVGxoyjZIlaH51UHXk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031