UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tqdDQx7aMkU3MP3BiiWHkOSNnWQ9dwkQHDbaNce9Kxc=' 
WHERE 
  key_id = 'c658b8ccaf1067a48d1711be93c6dbbdb88cbd0a64cd02da5dda1ac461dace6b' 
  AND (
    token = 'tqdDQx7aMkU3MP3BiiWHkOSNnWQ9dwkQHDbaNce9Kxc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028