UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jV8ug3JGHaTGdHWD4Kr42GXsalMdCjSanhnYKgcD9Hk=' 
WHERE 
  key_id = '056ec93de7f49dea57d5dd8c3dc4e8375b09cc262abca048091d546328b40ff0' 
  AND (
    token = 'jV8ug3JGHaTGdHWD4Kr42GXsalMdCjSanhnYKgcD9Hk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031